#include <stdio.h>
#include <stdlib.h>

int a = 78;
int b = 96;
int* p1 = &a;
int* p2 = &b;

int f1(int a,int b)//使用指针可以把解引用的值进行赋值运算
{
    int *t;
    *t = *p1;
    *p1 = *p2;
    *p2 = *t;
    printf("改变后的值为:a=%d,b=%d",*p1,*p2);
}

int f2(int a,int b)//形参不能传实参值，函数内只是形参进行运算改变
{
    int t = a;
    a = b;
    b = t;
}

int main()
{
    f2(a,b);
    printf("a=%d,b=%d",a,b);
    printf("\n");
    //f1(a,b);
    //printf("a=%d,b=%d",a,b);
    //printf("\n");
}